package com.service.totalauth.service;

import com.service.config.utils.Result;
import com.service.totalauth.dto.AuthorizationDto;
import com.service.totalauth.entity.AuthorizationUser;

import java.util.List;

/**
 * 授权终端用户认证表(AuthorizationUser)表服务接口
 *
 * @author makejava
 * @since 2021-12-03 09:38:42
 */
public interface AuthorizationUserService {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    AuthorizationUser queryById(String id);

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    List<AuthorizationUser> queryAllByLimit(int offset, int limit);

    /**
     * 新增数据
     *
     * @param authorizationUser 实例对象
     * @return 实例对象
     */
    AuthorizationUser insert(AuthorizationUser authorizationUser);

    /**
     * 修改数据
     *
     * @param authorizationUser 实例对象
     * @return 实例对象
     */
    AuthorizationUser update(AuthorizationUser authorizationUser);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    boolean deleteById(String id);

    /**
     * 授权1--飞书 2--钉钉 6--qq认证 7--支付宝认证 用户认证
     * @param bAuthToken
     * @param authorizationDto
     * @return
     * @throws Exception
     */
    Result checkUser(String bAuthToken, AuthorizationDto authorizationDto) throws Exception;

    Result decrypt(String code,String programmeInfoBindId,String redisToken,String bAuthToken,String nickName,String phoneCode) throws Exception;

    Result getAuthorizationDetail(String redisToken);

    Result getCodeDetail(String wxToken, String redisToken, String qyToken,String code) throws Exception;

    /**
     * 企业微信授权上网
     * @param code
     * @param redisToken
     * @param bAuthToken
     * @param time
     * @param isAuth
     * @return
     * @throws Exception
     */
    Result checkUserByQYWeChat(String code,String redisToken,String bAuthToken,Integer time,Boolean isAuth) throws Exception;
    Result checkQyWeiUser(AuthorizationDto authorizationDto,String bAuthToken,String wxAuth) throws Exception;

    Result getUrlScheme(AuthorizationDto authorizationDto, Integer type) throws Exception;

    Result getDingDingToken(AuthorizationDto authorizationDto) throws Exception;

    /**
     * 企业微信应用认证
     * @param code
     * @param bAuthToken
     * @param time
     * @return
     */
    Result authUserByQYApp(String code, String bAuthToken,String redisToken) throws Exception;

    Result saveParam(AuthorizationDto authDto) throws Exception;

}
